package com.yy.yyui.button
{
	import com.siku.manor.view.common.UM;
	import com.siku.manor.view.component.GT;
	import com.siku.manor.view.component.IClick;
	
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.events.MouseEvent;

	public class UpDownButton implements IClick
	{
		private var w:Number,h:Number;
		private var _actions:Object;

		public function UpDownButton()
		{
			super();
			this._actions = {};
			this.actions.onTurnPage = null;				
		}
		public function set onTurnPage(value:Function):void
		{
			this.actions.onTurnPage = value;
		}
		public function get onTurnPage():Function
		{
			return this.actions.onTurnPage;
		}		
		/**
		 * 
		 * @param page
		 * 
		 */
		public function set currentPage(page:Object):void
		{
			this.actions.currentPage = page;
		}
		public function get currentPage():Object
		{
			return this.actions.currentPage;
		}
		
		private function onClickNextPageHandler(e:MouseEvent):void
		{
			this.onTurnPage(true,this.currentPage);
		}
		private function onClickPrevPageHandler(e:MouseEvent):void
		{
			this.onTurnPage(false,this.currentPage);
		}	
		public function attachNextPageInteractiveObject(iClick:IClick):void{
			iClick.onClick = onClickNextPageHandler;
		}
		public function attachPrevPageInteractiveObject(iClick:IClick):void{
			iClick.onClick = onClickPrevPageHandler;
		}
					
	  	public function set onClick(value:Function):void{
			this.actions.onClick = value;
		}
		
		public function get onClick():Function{
			return this.actions.onClick;
		}
	   	public function get actions():Object{return this._actions;}
	}
}
